package com.sunlands.zlcx.usercenter.service;

import com.sunlands.zlcx.usercenter.domain.LatestVersionDO;
import com.sunlands.zlcx.usercenter.repository.LatestVersionRepository;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import static com.sunlands.zlcx.usercenter.config.RedisConfig.CacheKeys.APP_VERSION;

/**
 * @author anjl
 * @date 1:33 PM 2019/4/15
 * description:
 */
@Slf4j
@Service
public class LatestVersionServiceImpl {

    @Cacheable(cacheNames = APP_VERSION, key = "#app")
    public LatestVersionDO find(String app){
        return latestVersionRepository.findByApp(app);
    }

    @Autowired
    private LatestVersionRepository latestVersionRepository;

}
